I have run four separate experiments and now I will compare their different phenotype spatial correlations to see if I can tell the difference between each of the four experiments.
Experiments:
I am investigating the spatial phenotype correlation calculations. I predicted that though co-evolution (interaction & evolution) species’ phenotypes would become spatially correlated. I saw some very high correlations (around 0.5) in some of these simulations. To see if there is a difference between the correlations in my experiment I will create some comparative histograms.
Predictions:
First, I will try comparing the mean spatial correlations between the different experiments. Now within these four experiments, there are 16 GA combinations, which can have an effect on spatial phenotype correlation. Because each of these experiments contain the same GA combinations and the same amount of trials, it should be okay to compare them.
Note: Some of the simulations had fewer data points (data collected every 20 generations instead of 10). To account for fewer data points in some of the simulations, I cut about half of the data (everything had matching generations).
Here are the mean spatial phenotype correlation values:
## # A tibble: 4 × 2
## experiment name
## <chr> <dbl>
## 1 A 0.0451
## 2 B 0.0441
## 3 C -0.0000572
## 4 D 0.000542
I ran some anovas to compare the spatial correlations between the different experiments. First, I got one mean per GA combination. So all four trials were combined to create one spatial correlation mean.
## [1] "Anovas from mean of A and B, F value: 0.0142250171356741 Pr(>F) value: 0.905857605612402"
## [1] "Anovas from mean of A and C, F value: 15.3028300824105 Pr(>F) value: 0.000486194746054733"
## [1] "Anovas from mean of B and C, F value: 15.4617406836408 Pr(>F) value: 0.000459974110155801"
## [1] "Anovas from mean of A and D, F value: 4.43344247405991 Pr(>F) value: 0.0437188981583849"
## [1] "Anovas from mean of B and D, F value: 4.17738543344881 Pr(>F) value: 0.0498326721975504"
## [1] "Anovas from mean of C and D, F value: 0.0010887102609239 Pr(>F) value: 0.973896644087892"
I ran some more anovas to compare the spatial correlations between the different experiments. This time there is one mean per GA combination trial. So all four trials have their own spatial correlation mean.
## [1] "Anovas from mean of A and B, F value: 0.00427732092878269 Pr(>F) value: 0.94795986806371"
## [1] "Anovas from mean of A and C, F value: 14.4772190550698 Pr(>F) value: 0.000220915656425889"
## [1] "Anovas from mean of B and C, F value: 17.0989058190045 Pr(>F) value: 6.45957866715974e-05"
## [1] "Anovas from mean of A and D, F value: 5.57416154086401 Pr(>F) value: 0.0197737266431113"
## [1] "Anovas from mean of B and D, F value: 5.75152434006994 Pr(>F) value: 0.0179526371681008"
## [1] "Anovas from mean of C and D, F value: 0.00169167824590094 Pr(>F) value: 0.967257347995101"
Instead on taking the mean spatial correlation, I wanted to compare the series of correlation values from the each of my GA combinations. I think trials within a simulation experiment (A, B, C, D) should be the same (same mu and mu effect size). The spatial correlation might be different between different GA combinations within an experiment (A, B, C, D), but different between these experiments. Its a bit difficult to split my data up to make these comparisons, but I did run some wilcoxon tests and t-tests. Most everything was significantly different (only tested between experiments) in the wilcoxon test. In the Two Sample t-test when compering experiments AC, AD, BC, BD were different, but CD was not different. The Two Sample t-test between AB as only slightly different p-value = 0.02601.
In this section I examine the distribution of spatial phenotype correlation between each of the four experiments by genetic architecture (GA) combination. In this figure there are 4 trials per GA combination and experiment. There are sixteen GA combinations and four experiments (red = tall map 5 sections, green = tall map 7 sections, blue = no heritability, purple = no interaction). The labels on the right are the GA combinations.
This plot is not the easiest to read. However, after staring at if for awhile I noticed that the no heritability experiment did not change between GA combos. Red (tall map 5 sections), green (tall map 7 sections), and purple (no interaction) look very similar for some of the GA combinations, but differ in GA combinations where the mutational variance in both the newts and snakes was high. I thought the distributions between A and B would be more similar. The mean of experiment B results seems to be similar to experiment A, but the distribution seems a bit more narrow. It is very difficult to tell if things are truly similar or different.
In this section I combine all of the trails and GA combinations to see if the spatial correlation distribution differs overall between the experiments. Here red is the tall map 5 sections, green is the tall map 7 sections, blue is the experiment that has no heritability, and purple there is no interaction.
There are some very noticeable differences between the four experiments. One the mean of experiment A and B (tall map 5 sections & tall map 7 sections) are very similar, both are positive. Experiment B is narrower than experiment A. Experiment C is a perfect histogram with a mean at 0. Experiment D has a similar width to experiment A, but the mean is closer to 0.
In this sections I will walk through the spatial phenotype correlates of all 4 experiments in 5,000 generation chunks. The color represents the experiment (red = tall map 5 sections, green = tall map 7 sections, blue = no heritability, purple = no interaction). One type of plot is a general histogram an the other is a density plot. They are not stacked. The goal of these plots is to see how spatial correlation changes as time increases. The dashed line is the real newt and snake spatial phenotype correlation.
There are a few points of interest to note in these spatial correlation results. First, the no heritability distribution always remains the same (regardless of GA combination or time). When the GA combination has higher mutational variance there is less of a range in the possible spatial correlations, especially when there is no interaction. The spatial correlations in these simulations do not consistently reach the high levels of spatial correlation seen in the real newt and snake population. Experiment D seems to either be more variable in spatial correlation (more spread out, different in different simulation trial) or centered to the just to the left of zero (cor is negative). I think that there is a lot of noise and over lap. From these spatial correlation values I cannot immediately see the difference in all of the GA combinations (there is not one rule I would use to define all of these results).
This section will focus on the showing the spatial correlation for the whole simulation separated by GA combination. The goal is to see if the overall spatial correlation simulation results differ between experiments. Dashed line is the real newt and snake phenotype correlation value. Colors: red = tall map 5 sections, green = tall map 7 sections, blue = no heritability, purple = no interaction
Again, no heritability stands out as unchanging. At GA combinations where there is low variation red (tall map 5 sections), green (tall map 7 sections), and purple (no interaction) look ver similar. At the genetic variation in one of the species increases, the spatial correlation in no interaction simulation becomes more negative.
This section examines the amount of data points that reach and exceed an arbitrary limit. For example, I pick a limit of 0.3, and I would like to count the amount of spatial correlation points are above 0.3 or below -0.3. I can also look at just the positive or negative correlations. The goal of this section is to see how the different experiments (A, B, C, D) vary in the edges of the spatial correlation.
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 16969
## 2 B 10650
## 3 C 690
## 4 D 16138
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 8893
## 2 B 4671
## 3 C 662
## 4 D 14893
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 25862
## 2 B 15321
## 3 C 1352
## 4 D 31031
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 2344
## 2 B 1346
## 3 C 11
## 4 D 5053
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 2272
## 2 B 903
## 3 C 5
## 4 D 2400
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 4616
## 2 B 2249
## 3 C 16
## 4 D 7453
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 95
## 2 B 39
## 3 C 0
## 4 D 401
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 361
## 2 B 191
## 3 C 0
## 4 D 16
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 456
## 2 B 230
## 3 C 0
## 4 D 417
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 2
## 2 B 1
## 3 C 0
## 4 D 1
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 1
## 2 B 2
## 3 C 0
## 4 D 0
## # A tibble: 4 × 2
## `get(whichgroup)` n
## <chr> <int>
## 1 A 3
## 2 B 3
## 3 C 0
## 4 D 1
From this analysis of generations 100 to 50,000 I can see that no heritability (experiment C) has very few high spatial correlation measurements. The tall map 7 sections (experiment B) also has fewer high correlation measurements. Both tall map 5 sections and no interaction (A and D) have similar high correlation measurements. When the limit is low (0.3) there is more negative correlations in experiment D. But when the limit gets higher the amount of positive correlations in experiment D becomes a lot larger than the amount of negative correlation values. There are more negative correlation in experiment A when the limit is high. If I just look at the last 5,000 generations I see a similar pattern.
In this section I am testing out the ggplot multi plot function (ggslide). It adds side plot on the side or top. So I decided to look at the distribution of correlation values in both a density and a boxplot. I also attempted to graph the phenotype spatial correlation and population spatial correlation through out time. These plots contain all data points from all GA combinations and trials.
The findings from this figure highlights that experiment A and B have a positive phenotype spatial correlation. In the experiments with no heritability and no interaction, the mean spatial phenotype correlation is zero or negative. The second figure shows that time doesn’t have a strong association with a particular spatial correlation value. There is a problem with the population size spatial correlation in experiment C and D. The correlation should be more negative, but I switched the slim function to not account for the smaller areas (which is wrong) and had a huge effect on the correlation measurement. I imagine if I reran this experiment the no heritability and no interaction simulation would have the same population size spatial correlation as A and B (since the interaction is density dependent even though the way they interact is random).
My over all thought about the spatial phenotype correlation values is that they are not doing what I expect. There seems to be something missing in my simulation preventing a strong positive phenotype spatial correlation. My next experiments will look at how the cost function and interaction rate. I wonder if changing these will have an impact on my simulation.